package com.scedu.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

//自定义注解
public class Test03 {
    @MyAnnotation2 (name = "我的注解名称", schools = {"湖大","农大"})
    public void test(){

    }
    @MyAnnotation3("AA")
    public void  test2(){

    }
}
@Target({ ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation2{
    //注解的参数:参数类型+参数名()；
    String name() default "";
    int age() default 0;
    int id() default -1;
    String[] schools() default {"师大","长大"};
}

@Target({ ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation3{
    //注解的参数:参数类型+参数名()；
    String value() ;

}
